import {
	Checkbox,
	CheckboxGroup,
	Toast,
	Dialog,
	Button,
	Lazyload,
	Popup,
	PullRefresh,
	AddressList,
	AddressEdit,
	Area,
	Tabbar,
	TabbarItem,
	Form,
	Field,
	CellGroup,
	Divider,
	DropdownMenu,
	DropdownItem,
	Search,
	Image as VanImage,
	NavBar,
	ActionBar,
	ActionBarIcon,
	ActionBarButton,
	Tag,
	Uploader,
	Tab,
	Tabs,
	Card,
	List,
	Icon,
	SubmitBar,
	SwipeCell,
	Swipe,
	SwipeItem,
	Loading
} from 'vant';

const Components = [
	Checkbox,
	CheckboxGroup,
	Toast,
	Button,
	Dialog,
	Lazyload,
	Popup,
	PullRefresh,
	AddressList,
	AddressEdit,
	Area,
	Tabbar,
	TabbarItem,
	Form,
	Field,
	CellGroup,
	Divider,
	DropdownMenu,
	DropdownItem,
	Search,
	VanImage,
	NavBar,
	ActionBar,
	ActionBarIcon,
	ActionBarButton,
	Tag,
	Uploader,
	Tab,
	Tabs,
	Card,
	List,
	Icon,
	SubmitBar,
	SwipeCell,
	Swipe,
	SwipeItem,
	Loading
];

export default function UIComponents(app) {
	app.config.globalProperties.$toast = Toast;
	app.config.globalProperties.$dialog = Dialog;
	Components.forEach((ui) => {
		app.use(ui);
	});
}
